using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ModelTools._Iterator
{
    /// <summary>
    /// <para>Iterate Fields</para>
    /// <para>Iterates fields in a table.</para>
    /// <para>循环访问表中的字段。</para>
    /// </summary>    
    [DisplayName("Iterate Fields")]
    public class IterateFields : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public IterateFields()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_table">
        /// <para>Input Table</para>
        /// <para>The input table with fields to be iterated.</para>
        /// <para>包含要迭代的字段的输入表。</para>
        /// </param>
        public IterateFields(object _in_table)
        {
            this._in_table = _in_table;
        }
        public override string ToolboxName => "Model Tools";

        public override string ToolName => "Iterate Fields";

        public override string CallName => "mb.IterateFields";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_table, _field_type, _wildcard, _input_fields, _output_field, _output_count];

        /// <summary>
        /// <para>Input Table</para>
        /// <para>The input table with fields to be iterated.</para>
        /// <para>包含要迭代的字段的输入表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_table { get; set; }


        /// <summary>
        /// <para>Field Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the field type used to filter the fields. If a field type is not specified, all fields of the supported field types will be iterated.</para>
        ///   <bulletList>
        ///     <bullet_item>Blob—BLOB fields will be iterated.</bullet_item><para/>
        ///     <bullet_item>Date—Date fields will be iterated.</bullet_item><para/>
        ///     <bullet_item>Double—Double fields will be iterated.</bullet_item><para/>
        ///     <bullet_item>Float—Float fields will be iterated.</bullet_item><para/>
        ///     <bullet_item>GUID—GUID fields will be iterated.</bullet_item><para/>
        ///     <bullet_item>Long—Long integer fields will be iterated.</bullet_item><para/>
        ///     <bullet_item>Raster—Raster fields will be iterated.</bullet_item><para/>
        ///     <bullet_item>Short—Short integer fields will be iterated.</bullet_item><para/>
        ///     <bullet_item>Text—Text fields will be iterated.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定用于筛选字段的字段类型。如果未指定字段类型，则将迭代支持的字段类型的所有字段。</para>
        ///   <bulletList>
        ///     <bullet_item>Blob - 将迭代 BLOB 字段。</bullet_item><para/>
        ///     <bullet_item>日期 - 将迭代日期字段。</bullet_item><para/>
        ///     <bullet_item>Double—将迭代 Double 字段。</bullet_item><para/>
        ///     <bullet_item>Float—将迭代浮点字段。</bullet_item><para/>
        ///     <bullet_item>GUID - 将迭代 GUID 字段。</bullet_item><para/>
        ///     <bullet_item>Long—将迭代长整数字段。</bullet_item><para/>
        ///     <bullet_item>栅格—将迭代栅格字段。</bullet_item><para/>
        ///     <bullet_item>短—将迭代短整数字域。</bullet_item><para/>
        ///     <bullet_item>文本 - 将迭代文本字段。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _field_type { get; set; } = null;


        /// <summary>
        /// <para>Wildcard</para>
        /// <para>Limits the fields that will be iterated. The wildcard works on both field names and field aliases and is a combination of * and other characters. For example, this parameter can be used to restrict iteration of input field names or field aliases starting with a certain character or word (for example, A* or Ari* or Land*, and so on). An asterisk is equivalent to searching for all the fields. If a wildcard is not specified, all inputs will be returned.</para>
        /// <para>限制将要迭代的字段。通配符适用于字段名称和字段别名，并且是 * 和其他字符的组合。例如，此参数可用于限制以特定字符或单词开头的输入字段名称或字段别名的迭代（例如，A* 或 Ari* 或 Land* 等）。星号等同于搜索所有字段。如果未指定通配符，则将返回所有输入。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Wildcard")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _wildcard { get; set; } = null;


        /// <summary>
        /// <para>Field Names</para>
        /// <para>The list of fields that will be iterated.</para>
        /// <para>将要迭代的字段列表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Names")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _input_fields { get; set; } = null;


        /// <summary>
        /// <para>Value</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Value")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _output_field { get; set; }


        /// <summary>
        /// <para>Count</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Count")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public long? _output_count { get; set; }


        public IterateFields SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}